const axios = require("axios");
const { JUEJIN_COOKIE } = require("../config/index");

const juejinRequest = axios.create({
    baseURL: "https://api.juejin.cn",
    timeout: "5000",
    headers: {
        cookie: JUEJIN_COOKIE
    }
})

const pushPlusRequest = axios.create({
    baseURL: "http://www.pushplus.plus",
    timeout: "5000"
})

juejinRequest.interceptors.response.use(
    response => response,
    error => {
        return Promise.reject(error)
    }
)

module.exports = {
    juejinRequest,
    pushPlusRequest
}